<?php

class Admin_IndexController extends Zend_Controller_Action
{

   protected $_administrador;

    public function init()
    {

        $this->_helper->layout->setLayout('admin');
        
        $this->view->headLink()->appendStylesheet('/css/layout.css');
        $this->view->headScript()->appendFile('/js/jquery-1.3.2.min.js');
        $this->view->headScript()->appendFile('/js/easyTooltip.js');
        $this->view->headScript()->appendFile('/js/jquery-ui-1.7.2.custom.min.js');

        $this->view->headScript()->appendFile('/js/hoverIntent.js');
        $this->view->headScript()->appendFile('/js/superfish.js');

        $this->view->headScript()->appendFile('/js/jquery.alerts.js');
        $this->view->headLink()->appendStylesheet('/css/jquery.alerts.css');

        $this->view->headScript()->appendFile('/js/jquery.filestyle.mini.js');
        $this->view->headScript()->appendFile('/js/custom.js');

    }

    public function preDispatch()
    {

       if (admin_Model_Login::isLoggedIn()) {
           $this->view->loggedIn = true;
           $this->_administrador = admin_Model_Login::getIdentity();
       }else{
           $this->_redirect('/admin/login/');
       }

    }

    public function indexAction()
    {
       $this->view->headTitle('Qué desea hacer?');
       $this->view->titulo  = 'Qu&eacute; desea hacer?';
       $this->view->administrador = $this->_administrador;
    }


}

